<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>猜数字游戏</title>
  <script src="jquery.min.js"></script>
</head>
<body>
<div>
  <h1>猜数字游戏</h1>
  玩家输入一个1-10的数字：<input id="input_num" type="text"><p></p>
  <input type="button" value="查看结果" onclick="selectResultJq()">
  <div id="result_div">

  </div>
</div>
<script>
			function selectResultJq(){
				var randomNum=1+Math.floor(Math.random()*10);
				var userInputNum=jQuery("#input_num").val();
				var msg;
				if(randomNum==userInputNum){
					msg="<h3>猜对了！！！</h3>"
				}else{
					msg="<h3>猜错了！！！正确的数字是："+randomNum+"</h3>"
				}
				jQuery("#result_div").html(msg);
			}
		</script>
</body>
</html>
